<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>产品详情</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    body {
      background-color: #f5f5f5;
      padding: 2rem;
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      padding: 2rem;
    }

    h1 {
      color: #2c3e50;
      border-bottom: 2px solid #3498db;
      padding-bottom: 1rem;
      margin-bottom: 2rem;
      font-size: 2.2rem;
    }

    .product-detail {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2rem;
      align-items: start;
    }

    .product-image {
      text-align: center;
      border-right: 1px solid #eee;
      padding-right: 2rem;
    }

    .product-image img {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      transition: transform 0.3s ease;
    }

    .product-image img:hover {
      transform: scale(1.02);
    }

    .product-info {
      padding: 1rem;
    }

    .info-item {
      margin-bottom: 1.5rem;
      font-size: 1.1rem;
    }

    .info-label {
      color: #7f8c8d;
      font-weight: 600;
      display: inline-block;
      width: 80px;
    }

    .info-value {
      color: #2c3e50;
      font-weight: 500;
    }

    .price {
      color: #e74c3c;
      font-size: 1.4rem;
      font-weight: bold;
    }

    @media (max-width: 768px) {
      .product-detail {
        grid-template-columns: 1fr;
      }

      .product-image {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #eee;
        padding-bottom: 2rem;
      }
    }
  </style>
</head>
<body>
<div class="container">
  <h1>产品详情</h1>

  <div class="product-detail">
    <div class="product-image">
      <img th:src="${product.img}" alt="产品图片">
    </div>

    <div class="product-info">
      <div class="info-item">
        <span class="info-label">名称：</span>
        <span class="info-value" th:text="${product.pname}"></span>
      </div>

      <div class="info-item">
        <span class="info-label">价格：</span>
        <span class="info-value price" th:text="'¥' + ${product.price}"></span>
      </div>

      <div class="info-item">
        <span class="info-label">库存：</span>
        <span class="info-value" th:text="${product.stock} + ' 件'"></span>
      </div>
    </div>
  </div>
</div>
</body>
</html>